import service from '@/utils/Request'
export function toLogin(data) {
    return service({
      url: `/login`,
      method: 'post',
      data
    })
  }
  export function toRegister(data) {
    return service({
      url: `/register`,
      method: 'post',
      data
    })
  }

  export function getUserInfo() {
    return service({
      url: `/currentUser/info`,
      method: 'get',
    })
  }

  export function getHobby(id) {
    return service({
      url: `/hobbies/${id}`,
      method: 'get',
    })
  }

  export function getOtherinfo(id) {
    return service({
      url: `/users/${id}`,
      method: 'get',
    })
  }

  export function getEmail(email) {
    return service({
      url: `/email?email=${email}`,
      method: 'get',
    })
  }

  export function updatePassword(email,password) {
    return service({
      url: `/login/password?email=${email}&password=${password}`,
      method: 'put',
    })
  }

  export function focus(userId) {
    return service({
      url: `/focus?userId=${userId}`,
      method: 'post',
    })
  }
  export function cancelFocus(userId) {
    return service({
      url: `/focus/${userId}`,
      method: 'delete',
    })
  }

  export function getFocus() {
    return service({
      url: `/focus/currentUser`,
      method: 'get',
    })
  }
  export function getFans() {
    return service({
      url: `/follows/currentUser`,
      method: 'get',
    })
  }